TGML Line

The <Line> element describes a straight line between two points.

Attribute Type Description

Opacity

Double

A value between "0.0" (transparent) and "1.0" (opaque)
Default: "1.0"
Inheritable: No
Animatable: Yes

Stroke

Brush

Describes how the line is painted.
Default: "#000000"
Inheritable: Yes
Animatable: Yes

StrokeDashArray

Array of Double

The pattern of dashes and gaps used to outline shapes:
"<dash> [ <gap> <dash> <gap>...]"
If the array only specifies the first dash, the line is patterned as if a gap with the same length as the dash was specified.
An array with only one dash set to "0" will result in a line without any pattern.
Default: "0"
Inheritable: Yes
Animatable: Yes

StrokeWidth

Double

The width of the outline of a line.
Default: "1"
Inheritable: Yes
Animatable: Yes

Visibility Visibility

Specifies if the element shall be visible or not.
Default: "Visible"
Inheritable: No
Animatable: Yes

X1

Double

The x coordinate of the line start point.
Default:"0"
Inheritable: No
Animatable: Yes

X2

Double

The x coordinate of the line end point.
Default:"0"
Inheritable: No
Animatable: Yes

Y1

Double

The y coordinate of the line start point.
Default:"0"
Inheritable: No
Animatable: Yes

Y2 Double

The y coordinate of the line end point.
Default:"0"
Inheritable: No
Animatable: Yes

Example:

Copy
<TGML>

    <Line X2="100.0" Y2="50.0"/>

    <Line Xl="50.0" Yl="50.0" X2="150.0" Y2="100.0" Stroke="#0000FF" StrokeWidth="2" StrokeDashArray="5.0 3.0 2.0 3.0"/>

    <Line Xl="25.0" Yl="65.0" X2="150.0" Y2=”125.0" Stroke="#FF0000" StrokeWidth="2" StrokeDashArray="5.0"/>

</TGML>

Example on screen: